using System.IO;
using System.Net;

namespace testy {
    
    public class Downloader {
        public static string Download(string url) {
            string responseFromServer;
            var request = (HttpWebRequest) WebRequest.Create(url);
            request.UserAgent = ".NET Framework Example Client";
            using (var response = (HttpWebResponse) request.GetResponse()) {
                //response.ContentEncoding
                Stream dataStream = response.GetResponseStream();
                using (var reader = new StreamReader(dataStream)) {
                    responseFromServer = reader.ReadToEnd();
                }
            }
            return responseFromServer;
        }
    }
}